package com.example.demo.service.impl;

import com.example.demo.mapper.DraftMapper;
import com.example.demo.pojo.Draft;
import com.example.demo.service.DraftService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2023-02-21
 * Time: 10:36
 */
@Service
public class DraftServiceImpl implements DraftService {

    @Autowired
    DraftMapper draftMapper;

    @Override
    public int saveDraft(Integer uid, String title, String content) {
        return draftMapper.saveDraft(uid,title,content);
    }

    @Override
    public List<Draft> getDraftList(Integer id) {
        return draftMapper.getDraftList(id);
    }


    @Override
    public Draft detailDraft(Integer aid) {
        return draftMapper.detailDraft(aid);
    }

    @Override
    public int updateDraft(Integer aid, Integer uid, String title, String content) {
        return draftMapper.updateArticle(aid, uid, title, content);
    }

    @Override
    public int deleteDraft(Integer aid) {
        return draftMapper.deleteDraft(aid);
    }
}
